"""
全局变量模块
用于存储和管理全局变量
"""

class Variables:
    def __init__(self):
        self._variables = {}
        
    def __getitem__(self, key):
        return self._variables.get(key)
        
    def __setitem__(self, key, value):
        self._variables[key] = value
        
    def get(self, key, default=None):
        return self._variables.get(key, default)
        
    def set(self, key, value):
        self._variables[key] = value
        
    def clear(self):
        self._variables.clear()

# 创建全局变量实例
variables = Variables() 